
from visual import *

def cc(value):
	return value / 255.0

class Teren:
	""" Represents table
	"""
	def __init__(self):
		self._base = box(pos=(0,0,-1), length=3000, width=2100, height=50, color=(cc(14),cc(131),cc(200)), up=(0,0,1))
		self._redstart = box(pos=(1250,800,0), length=500, width=500, height=50, color=(cc(255),cc(28),cc(31)), up=(0,0,1))
		self._greenstart = box(pos=(-1250,800,0), length=500, width=500, height=50, color=(cc(96),cc(180),cc(84)), up=(0,0,1))
		## central buliding site:
		self._buildingsite_3 = cylinder(pos=(0,0,25), axis=(0,0,60), radius=150, color=(cc(201),cc(106),cc(22)), up=(0,0,1))
		## zero level buliding site:
		self._buildingsite_1 = box(pos=(0,-1050+50-1,0), length=1800, width=100, height=50, color=(cc(201),cc(106),cc(22)), up=(0,0,1))
		## middle buliding site:
		self._buildingsite_2 = box(pos=(0,-1050+50-1,30), length=600, width=100, height=50+30, color=(cc(201),cc(106),cc(22)), up=(0,0,1))
		self._fixed_columnelement_positions, self._markings, self._lintels_placeholders = [], [], []
		
		for dx in [400, 650, 850, -400, -650, -850,]:
			for dy in [-125, 75, 275, 475,]:
				self._fixed_columnelement_positions.append( 
					cylinder(pos=(dx, dy, 0.0), axis=(0,0,25), radius=20, color=(0.3, 0.3, 0.3), up=(0,0,1)) 
					)
		
		for dx in range(15):
			if dx not in [0, 5, 10,]:
				self._markings.append( 
					box(pos=((120 * dx) - 900, -950+125, 0.0), length=15, width=250, height=50, color=(0.4,0.4,0.4), up=(0,0,1))
					) 
		
		for dx in range(4):
			self._markings.append( 
				box(pos=((400 * dx) - 600, 1050-125, 0.0), length=15, width=250, height=50, color=(0.4,0.4,0.4), up=(0,0,1))
				)
			ColoR = (cc(96),cc(180),cc(84))
			if dx > 1: ColoR = (cc(255),cc(28),cc(31))
			self._lintels_placeholders.append(
				box(pos=((400 * dx) - 600, 1050+35, 50+ 70+15), length=200, width=70, height=30, color=ColoR, up=(0,0,1))
				)
		
		self._borders = []
		self._borders.append( box(pos=(-900-11,-1050+50+1,25+35), length=22, width=100, height=50+70, color=(1,1,1), up=(0,0,1)) )
		self._borders.append( box(pos=(900+11,-1050+50+1,25+35), length=22, width=100, height=50+70, color=(1,1,1), up=(0,0,1)) )
		self._borders.append( box(pos=(0,1050,25+35), length=3046, width=22, height=50+70, color=(1,1,1), up=(0,0,1)) )
		self._borders.append( box(pos=(1500+11,0,25+35), length=22, width=2100, height=50+70, color=(1,1,1), up=(0,0,1)) )
		self._borders.append( box(pos=(-1500-11,0,25+35), length=22, width=2100, height=50+70, color=(1,1,1), up=(0,0,1)) )
		
		self._dispansers = []
		self._dispansers.append( cylinder(pos=(1500-40, 250, 25+45), axis=(0,0,150), radius=40, color=(cc(96),cc(180),cc(84)), up=(0,0,1)) )
		self._dispansers.append( cylinder(pos=(1500-40, -250, 25+45), axis=(0,0,150), radius=40, color=(cc(96),cc(180),cc(84)), up=(0,0,1)) )
		self._dispansers.append( cylinder(pos=(-1500+40, 250, 25+45), axis=(0,0,150), radius=40, color=(cc(255),cc(28),cc(31)), up=(0,0,1)) )
		self._dispansers.append( cylinder(pos=(-1500+40, -250, 25+45), axis=(0,0,150), radius=40, color=(cc(255),cc(28),cc(31)), up=(0,0,1)) )
		self._dispansers.append( cylinder(pos=(1500-289, -1050+40, 25+45), axis=(0,0,150), radius=40, color=(cc(96),cc(180),cc(84)), up=(0,0,1)) )
		self._dispansers.append( cylinder(pos=(-1500+289, -1050+40, 25+45), axis=(0,0,150), radius=40, color=(cc(255),cc(28),cc(31)), up=(0,0,1)) )












